<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html lang="zh-CN">

    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, shrink-to-fit=no, initial-scale=1">
        <meta name="description" content="">
        <meta name="author" content="">

        <title>欢迎进入教务管理系统</title>

        <!-- Bootstrap Core CSS -->
        <link href="<%=request.getContextPath()%>/css/common_css/bootstrap_css/bootstrap.min.css" rel="stylesheet">

        <!-- Custom CSS -->
        <link href="<%=request.getContextPath()%>/css/common_css/sidebar_css/sidebar.css" rel="stylesheet">

        <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
        <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
            <!--[if lt IE 9]>
                <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
                <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
                <![endif]-->
        <script type="text/javascript">
            function getInfo(str) {
                var cont=document.getElementById("txt").value
                var link=document.getElementById("test")
                link.setAttribute("href","searchInfo!searchCourse.action?stuid="+str+"&keyword="+cont)
                link.click()
            }
            function  check(courseid,stuid) {
                var isconfirm=confirm("确定退课吗?")
                if(isconfirm==true){
                    var testhref=document.getElementById("test")
                    testhref.setAttribute("href","delSelectionCourse!delSel.action?stuid="+stuid+"&courseid="+courseid)
                    testhref.click()
                }else{

                }
            }
        </script>
    </head>

        <body>

            <div id="wrapper">

                <!-- Sidebar -->
                <div id="sidebar-wrapper">
                    <ul class="sidebar-nav">

                        <!-- 标题 -->
                        <li class="sidebar-brand">
                            <a href="#">
                                教务管理系统
                            </a>
                        </li>

                        <!-- 排课子系统 -->
                        <li>
                        </li>

                        <!-- 毕设管理子系统 -->
                        <li>
                        </li>

                        <!-- 后台管理子系统 -->
                        <li>
                        </li>

                        <!-- 成绩查询子系统 -->
                        <li>
                        </li>

                        <!-- 选课子系统 -->
                        <li>
                            <a href="javascript:;" data-toggle="collapse" data-target="#selection">选课</a>
                            <ul id = "selection" class="collapse">
                                <li>
                                    <a href="<%=request.getContextPath()%>/htmls/selection/student.jsp">我的课程</a>
                                </li>
                            </ul>
                        </li>

                        <!-- 注销 -->
                        <li>
                            <a href="<%=request.getContextPath()%>/login.jsp">注销</a>
                        </li>

                        <li>
                            <a href="#">关于本站</a>
                        </li>
                    </ul>
                </div>
                <!-- /#sidebar-wrapper -->

                <!-- Page Content -->
                <div id="page-content-wrapper">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-lg-12">
                                
                                <!-- 选课导航栏 -->
                                <nav class="navbar navbar-default" role="navigation">
                                    <div class="container-fluid">
                                        <div>
                                            <div class="navbar-form navbar-right" role="search">

                                                <a href="#menu-toggle" class="btn btn-default" id="menu-toggle">菜单</a>
                                            </div>
                                        </div>
                                        <div>
                                           <ul class="nav navbar-nav">
                                              <li class="active"><a href="#">我的课程</a></li>
                                              <li><a href="showCourseInfoAction!showCourseInfo?ctype=${'c'}&stuid=${stuid}&term=${'0'}">必修课程</a></li>
                                              <li><a href="showCourseInfoAction!showCourseInfo?ctype=${'e'}&stuid=${stuid}&term=${'0'}">选修课程</a></li>
                                              <li><a href="showCourseInfoAction!showCourseInfo?ctype=${'f'}&stuid=${stuid}&term=${'0'}">辅修课程</a></li>
                                          </ul>
                                        </div>
                                    </div>
                                </nav>
                                <!---->
                                <!--全部课程（包括已选和可选但未选的课程）-->
                                <div class="row clearfix">
                                    <div class="col-lg-12 column">
                                        <div class="table-responsive">
                                            <table class="table table-bordered table-condensed table-hover">
                                                <thead>
                                                    <tr>
                                                        <th>课程代码</th>
                                                        <th>课程名称</th>
                                                        <th>学分</th>
                                                        <th>授课教师</th>
                                                        <th>课程性质</th>
                                                        <th>选课情况</th>
                                                    </tr>
                                                </thead>
                                                <tbody>
                                                    <s:iterator value="compinfo" id="li" var="test">
                                                    <tr>
                                                        <td><s:property value="courseid"></s:property> </td>
                                                        <td id="">
                                                            <button class="btn btn-link"><a href="ShowDetailAction!showDetailCourse.action?courseid=${test.courseid}"><s:property value="coursename"></s:property> </a></button>
                                                        </td>
                                                        <td><s:property value="credit"></s:property> </td>
                                                        <td><s:property value="tname" ></s:property></td>
                                                        <td><s:property value="coursetype"></s:property> </td>
                                                        <td><s:property value="exitselect"></s:property> </td>
                                                    </s:iterator>
                                                    </tr>
                                                    <tr>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                        <td></td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </div>
                                    </div> 
                                </div>
                                <!---->
                                <!--底部导航-->
                                <div class="row clearfix">
                                    <div class="col-lg-6 column">
                                        <nav style="text-align: left">
                                            <ul class="pagination">
                                                <li><a href="#">«</a></li>
                                                <li><a href="#">1</a></li>
                                                <li><a href="#">2</a></li>
                                                <li><a href="#">3</a></li>
                                                <li><a href="#">»</a></li>
                                            </ul>
                                        </nav>  
                                    </div>
                                    <div class="col-lg-6 column">
                                        <div style="text-align: right">
                                            <button type="button" class="btn btn-default">返回</button>
                                        </div>
                                    </div>
                                </div>
                                <!---->
                            </div>
                        </div>                    
                    </div>
                </div>
                <!-- /#page-content-wrapper -->
            </div>
            <!-- /#wrapper -->

            <!-- jQuery -->
            <script src="<%=request.getContextPath()%>/js/common_js/jquery/jquery.min.js"></script>

            <!-- Bootstrap Core JavaScript -->
            <script src="<%=request.getContextPath()%>/js/common_js/bootstrap_js/bootstrap.min.js"></script>

            <!--这是按表格中关键字搜索的代码，我不确定有没有用-->
            <script>
                $(function(event){
                    $("#sch").click(function(){
                        var stxt=$("#txt").val();
                        if($.trim(stxt)!=""){
                            $("table tbody tr").hide().filter(":contains('"+stxt+"')").show();
                        }else{
                            $("table tbody tr").show();
                        }
                    });
                    //event.preventDefault();
                })
            </script>

            <!-- Menu Toggle Script -->
            <script>
                $("#menu-toggle").click(function(e) {
                    e.preventDefault();
                    $("#wrapper").toggleClass("toggled");
                });
            </script>
        </body>

</html>
